﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using gfLibrary;
using DBUtility;
using Model;
using BLL;

namespace GreatGF
{
    public partial class TYPE_CX_FDJ_UNION_Insert_Update : System.Web.UI.Page
    {
        private static string cxid { get; set; }
        private static string fdjid { get; set; }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack == false)
            {
                GetModel();
            }
            btnBack.Attributes["onclick"] = "javascript:window.location.href='TYPE_CX_FDJ_UNION_List.aspx';return false;";
        }

        protected void GetModel()
        {
            string strUId = Request["UniqueKey"];
            string strPPXH = "";
            string strFDJXH = "";
            TYPE_CX_FDJ_UNION_BLL m_TYPE_CX_FDJ_UNION_BLL = new TYPE_CX_FDJ_UNION_BLL();
            TYPE_CX_FDJ_UNION m_TYPE_CX_FDJ_UNION = new TYPE_CX_FDJ_UNION();
            m_TYPE_CX_FDJ_UNION = m_TYPE_CX_FDJ_UNION_BLL.GetModel(int.Parse(strUId));
            strPPXH = m_TYPE_CX_FDJ_UNION.PPXH;
            strFDJXH = m_TYPE_CX_FDJ_UNION.FDJXH;

            TYPE_CX_CONTENT_BLL m_TYPE_CX_CONTENT_BLL = new TYPE_CX_CONTENT_BLL();
            var m_TYPE_CX_CONTENT = m_TYPE_CX_CONTENT_BLL.GetModelList("PPXH='"+strPPXH+"'");

            for (int i = 0; i < m_TYPE_CX_CONTENT.Length; i++)
            {
                txtCXID.Text = m_TYPE_CX_CONTENT[i].ID.ToString();
                cxid = m_TYPE_CX_CONTENT[i].ID.ToString();
                txtCPMC.Text = m_TYPE_CX_CONTENT[i].CPMC;
                txtPP.Text = m_TYPE_CX_CONTENT[i].PP;
                txtXH.Text = m_TYPE_CX_CONTENT[i].XH;
                txtPPXH.Text = m_TYPE_CX_CONTENT[i].PPXH;
                txtCXDM.Text = m_TYPE_CX_CONTENT[i].CXDM;
                txtSFDABS.Text = m_TYPE_CX_CONTENT[i].SFDABS;
                txtABSZWZ.Text = m_TYPE_CX_CONTENT[i].ABSZWZ;
                txtQDXS.Text = m_TYPE_CX_CONTENT[i].QDXS;
                txtQDZWZ.Text = m_TYPE_CX_CONTENT[i].QDZWZ;
                txtZCZWZ.Text = m_TYPE_CX_CONTENT[i].ZCZWZ;
                txtQZDZ.Text = m_TYPE_CX_CONTENT[i].QZDZ;
                txtZBZL.Text = m_TYPE_CX_CONTENT[i].ZBZL;
                txtZZL.Text = m_TYPE_CX_CONTENT[i].ZZL;
                txtHDZH.Text = m_TYPE_CX_CONTENT[i].HDZH;
                txtZZS.Text = m_TYPE_CX_CONTENT[i].ZZS;
                txtCYS.Text = m_TYPE_CX_CONTENT[i].CYS;
                txtZGSJCS.Text = m_TYPE_CX_CONTENT[i].ZGSJCS;
                txtZDFS.Text = m_TYPE_CX_CONTENT[i].ZDFS;
                txtCLZL.Text = m_TYPE_CX_CONTENT[i].CLZL;
                txtZXZXJXS.Text = m_TYPE_CX_CONTENT[i].ZXZXJXS;
                txtZXZLX.Text = m_TYPE_CX_CONTENT[i].ZXZLX;
                txtBSXLX.Text = m_TYPE_CX_CONTENT[i].BSXLX;
                txtLTQY.Text = m_TYPE_CX_CONTENT[i].LTQY;
                txtLTGG.Text = m_TYPE_CX_CONTENT[i].LTGG;
                txtLTGGLX.Text = m_TYPE_CX_CONTENT[i].LTGGLX;
                txtLTSL.Text = m_TYPE_CX_CONTENT[i].LTSL;
                txtCSC.Text = m_TYPE_CX_CONTENT[i].CSC;
                txtCSK.Text = m_TYPE_CX_CONTENT[i].CSK;
                txtCSG.Text = m_TYPE_CX_CONTENT[i].CSG;
                txtZJ.Text = m_TYPE_CX_CONTENT[i].ZJ;
                txtBZZXS.Text = m_TYPE_CX_CONTENT[i].BZZXS;
                txtYZLJ.Text = m_TYPE_CX_CONTENT[i].YZLJ;
                txtEZLJ.Text = m_TYPE_CX_CONTENT[i].EZLJ;
                txtSZLJ.Text = m_TYPE_CX_CONTENT[i].SZLJ;
                txtSIZLJ.Text = m_TYPE_CX_CONTENT[i].SIZLJ;
                txtWZLJ.Text = m_TYPE_CX_CONTENT[i].WZLJ;
                txtLZLJ.Text = m_TYPE_CX_CONTENT[i].LZLJ;
                txtYZZLZ.Text = m_TYPE_CX_CONTENT[i].YZZLZ;
                txtYZYLZ.Text = m_TYPE_CX_CONTENT[i].YZYLZ;
                txtYZZZ.Text = m_TYPE_CX_CONTENT[i].YZZZ;
                txtEZZLZ.Text = m_TYPE_CX_CONTENT[i].EZZLZ;
                txtEZYLZ.Text = m_TYPE_CX_CONTENT[i].EZYLZ;
                txtEZZZ.Text = m_TYPE_CX_CONTENT[i].EZZZ;
                txtSZZLZ.Text = m_TYPE_CX_CONTENT[i].SZZLZ;
                txtSZYLZ.Text = m_TYPE_CX_CONTENT[i].SZYLZ;
                txtSZZZ.Text = m_TYPE_CX_CONTENT[i].SZZZ;
                txtSIZZLZ.Text = m_TYPE_CX_CONTENT[i].SIZZLZ;
                txtSIZYLZ.Text = m_TYPE_CX_CONTENT[i].SIZYLZ;
                txtSIZZZ.Text = m_TYPE_CX_CONTENT[i].SIZZZ;
                txtWZZLZ.Text = m_TYPE_CX_CONTENT[i].WZZLZ;
                txtWZYLZ.Text = m_TYPE_CX_CONTENT[i].WZYLZ;
                txtWZZZ.Text = m_TYPE_CX_CONTENT[i].WZZZ;
                txtLZZLZ.Text = m_TYPE_CX_CONTENT[i].LZZLZ;
                txtLZYLZ.Text = m_TYPE_CX_CONTENT[i].LZYLZ;
                txtLZZZ.Text = m_TYPE_CX_CONTENT[i].LZZZ;
                txtQDZKZZL.Text = m_TYPE_CX_CONTENT[i].QDZKZZL;
            }

            TYPE_FDJ_CONTENT_BLL m_TYPE_FDJ_CONTENT_BLL = new TYPE_FDJ_CONTENT_BLL();
            var m_TYPE_FDJ_CONTENT = m_TYPE_FDJ_CONTENT_BLL.GetModelList("FDJXH='"+strFDJXH+"'");

            for (int i = 0; i < m_TYPE_FDJ_CONTENT.Length; i++)
            {
                txtFDJID.Text = m_TYPE_FDJ_CONTENT[i].ID.ToString();
                fdjid = m_TYPE_FDJ_CONTENT[i].ID.ToString();
                txtFDJXH.Text = m_TYPE_FDJ_CONTENT[i].FDJXH;
                txtFDJZZC.Text = m_TYPE_FDJ_CONTENT[i].FDJZZC;
                txtRLLB.Text = m_TYPE_FDJ_CONTENT[i].RLLB;
                txtRYBH.Text = m_TYPE_FDJ_CONTENT[i].RYBH;
                txtGYFS.Text = m_TYPE_FDJ_CONTENT[i].GYFS;
                txtJQFS.Text = m_TYPE_FDJ_CONTENT[i].JQFS;
                txtEDGL.Text = m_TYPE_FDJ_CONTENT[i].EDGL;
                txtEDZS.Text = m_TYPE_FDJ_CONTENT[i].EDZS;
                txtEDNJZS.Text = m_TYPE_FDJ_CONTENT[i].EDNJZS;
                txtEDNJ.Text = m_TYPE_FDJ_CONTENT[i].EDNJ;
                txtEDYH.Text = m_TYPE_FDJ_CONTENT[i].EDYH;
                txtFDJPL.Text = m_TYPE_FDJ_CONTENT[i].FDJPL;
                txtFDJGS.Text = m_TYPE_FDJ_CONTENT[i].FDJGS;
                txtFDJCC.Text = m_TYPE_FDJ_CONTENT[i].FDJCC;
            }
        }

        protected void btnUpdateCX_Click(object sender, EventArgs e)
        {
            Response.Redirect("TYPE_CX_CONTENT_Insert_Update.aspx?m=u&UniqueKey=" + cxid);
        }

        protected void btnUpdateFDJ_Click(object sender, EventArgs e)
        {
            Response.Redirect("TYPE_FDJ_CONTENT_Insert_Update.aspx?m=u&UniqueKey=" + fdjid);
        }
    }
}
